-
Notifications
You must be signed in to change notification settings - Fork 56
Track variable locations #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
djolertrk
wants to merge
3
commits into
0xMiden:next
Choose a base branch
from
walnuthq:feature/debug-variable-locations-clean
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Track variable locations #820
djolertrk
wants to merge
3
commits into
0xMiden:next
from
walnuthq:feature/debug-variable-locations-clean
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Author
|
Goes on top of #812. |
Collaborator
Author
69877ae to
a4ccd95
Compare
Collaborator
Author
|
It depends on the types and debug decorator defined in 0xMiden/miden-vm#2471. |
Collaborator
|
I've done an initial review of the |
This commit adds debug information support for tracking variable locations through the compilation pipeline: - Add debug info representation on HIR level (builtin.dbg_value ops, DIExpression, DILocalVariable attributes) - Handle DebugVars during lowering from HIR to MASM - Add DebugInfoBuilder for constructing debug metadata - Add RemoveDeadDebugOps pass to clean up debug ops with dead operands - Add miden-debugdump tool for inspecting .debug_info sections in MASP packages (similar to llvm-dwarfdump) - Add documentation for the debug info format (docs/DebugInfoFormat.md, docs/DebugInfoMetadata.md) - Add lit tests for debug functionality Run tests: $ litcheck lit run --verbose tests/lit/debugdump $ litcheck lit run --path bin ./tests/lit/debug/
a4ccd95 to
885283c
Compare
- Check if WasmLocal value is on Miden operand stack before assuming it's in local memory (emit Stack(pos) if on stack) - Add post-processing in MasmFunctionBuilder::build() to patch Local(idx) with correct FMP offset - Compute num_wasm_locals = params_in_felts + hir_locals for correct offset calculation (DWARF WasmLocal uses WASM indexing where params come first) - Add patch_debug_var_locals_in_block() to recursively patch all DebugVar decorators in the MASM body
This was referenced Jan 19, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Track variable locations at HIR and MASM levels.
Add DebugVar decorator and new debug_info section in the final .masp.
Also, add
miden-debugdumptool to dump .debug_info section, so we can explore the custom section from the package.vm part: 0xMiden/miden-vm#2471